using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace FGServer
{
    class quotes
    {
        ArrayList quotelist = new ArrayList();
        Random r;        
        public quotes()
        {
             r = new Random();
        }

        public void loadQuotes(string filename)
        {
            try
            {
                StreamReader re = File.OpenText(filename);
                string input = null;
                while ((input = re.ReadLine()) != null)
                {
                    quotelist.Add(input);
                }
                re.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.ReadLine();
                Environment.Exit(0);
            }
        }
        
        public string getQuote()
        {
            int number = r.Next(quotelist.Count);
            return quotelist[number].ToString();
        }
    }
}
